{{Extend "layout"}}
{{Block "title"}}{{"网站列表"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"网站列表"|T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
				<div class="col-md-12">
					<div class="block-flat">
						<div class="header">
							<a href="/manage/vhost_build" class="pull-right btn btn-warning">
                                <i class="fa fa-refresh"></i>
                                {{"重建全部配置并重启Web服务"|T}}
                            </a>
							<h3>{{"网站列表"|T}}</h3>
						</div>
						<div class="content">
							<div class="table-responsive">
							<table class="table no-border hover">
								<thead class="no-border">
									<tr>
										<th style="width:2%;"><strong>ID</strong></th>
										<th><strong>{{"域名/网址/IP"|T}}</strong></th>
										<th><strong>{{"物理路径"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"创建时间"|T}}</strong></th>
										<th style="width:15%;"><strong>{{"更新时间"|T}}</strong></th>
										<th style="width:6%;"><strong>{{"状态"|T}}</strong></th>
										<th style="width:15%;" class="text-center"><strong>{{"操作"|T}}</strong></th>
									</tr>
								</thead>
								<tbody class="no-border-y">
                                    {{range $k,$v := Stored.listData}}
									<tr>
										<td>{{$v.Id}}</td>
										<td>
											{{if and (not (Contains $v.Domain "$")) (not (Contains $v.Domain "%")) }}
											{{if not (Contains $v.Domain "//")}}
											<a href="http://{{$v.Domain}}" target="_blank">{{$v.Domain}}</a>
											{{else}}
											<a href="{{Replace $v.Domain "*" "test" -1}}" target="_blank">{{$v.Domain}}</a>
											{{end}}
											{{else}}
											{{$v.Domain}}
											{{end}}
										</td>
										<td>{{$v.Root}}</td>
										<td>{{(Date $v.Created).Format "2006-01-02 15:04:05"}}</td>
										<td>{{if gt $v.Updated 0}}{{(Date $v.Updated).Format "2006-01-02 15:04:05"}}{{end}}</td>
                                        {{if eq $v.Disabled "Y"}}
										<td class="color-danger">{{"禁用"|T}}</td>
                                        {{else}}
                                        <td class="color-success">{{"启用"|T}}</td>
                                        {{end}}
										<td class="text-center">
											<a class="label label-success" href="/manage/vhost_edit?id={{$v.Id}}" title="{{"编辑"|T}}">
											<i class="fa fa-pencil"></i>
											</a>
											&nbsp;
											<a class="label label-danger" href="/manage/vhost_delete?id={{$v.Id}}" onclick="return confirm('{{"真的要删除吗？"|T}}');" title="{{"删除"|T}}">
											<i class="fa fa-times"></i>
											</a>
											{{if $v.Root}}
											&nbsp;
											<a class="label label-primary" href="/manage/vhost_file?id={{$v.Id}}" title="{{"文件管理"|T}}">
											<i class="fa fa-list-alt"></i>
											</a>
											{{end}}
										</td>
									</tr>
                                    {{end}}
								</tbody>
							</table>		
							</div>
							{{Stored.pagination.Render}}
						</div>
					</div>				
				</div>
			</div>
{{/Block}}